/*
 * ActionController.h
 *
 *  Created on: 09/giu/2011
 *      Author: lugas
 */

#ifndef ACTIONCONTROLLER_H_
#define ACTIONCONTROLLER_H_

#include "Aria.h"
#include "ActionGo.h"
#include "ActionScouting.h"
#include "ActionTurn.h"
#include "balloonVision.h"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/highgui/highgui_c.h"
#include <time.h>

#define SCOPPIA_PALLONE 1
#define EVITA_OSTACOLO 2
#define RAGGIUNGI_TARGET 3
#define ESPLORA 4
#define EVITA_MAGNETIZZATA 5

class ActionController: public ArAction {
public:

	ActionController(double stopDistance, double controlAngle,
			double velocityOnTarget, double velocityNearHurdle, double maxVelocity, ActionGo *go, ActionTurn *turn, ActionScouting *scout);

	virtual ~ActionController(void) {
	}
	;

	virtual ArActionDesired *fire(ArActionDesired currentDesired);

	virtual void setRobot(ArRobot *robot);

protected:

	ArRangeDevice *mySonar;


	ArActionDesired myDesired;
	double myVelocityNearHurdle, myMaxVelocity;
	double myStopDistance;
	double myControlAngle;
	double myVelocityOnTarget;

	ActionGo *myGo;
	ActionTurn *myTurn;
	ActionScouting *myScout;

	int state;


};


#endif /* ACTIONCONTROLLER_H_ */
